"""

@author: lingw
@email: gw.lin@hzgosun.com
@file: noticeManagePge.py
@time: 2019-5-24 下午 4:11

这一行开始写关于本文件的说明与解释

"""

from common.poium import Page
from common.vue.float_window import FloatWindow
from common.vue.table import VueTable, VueTurnPage
from common.vue.label import ElementType as ET
from common.vue.label import ElementBaseLabel
from common.vue.search import VueSearch
from common.vue.tree import VueTree, VueBoxTree
from common.vue.region import VueRegion
from common.vue.button import VueButton
from common.vue.element import VueElements

class SearchTools(VueSearch):
    """查询区域"""

    notice_grid = ElementBaseLabel(ET.GRID, "网格")
    notice_grid_select = VueBoxTree(index=0)
    notice_name = ElementBaseLabel(ET.INPUT, "公告名称")
    notice_search = VueButton("检索")

    def __init__(self):
        super(SearchTools, self).__init__()

class Table(VueTable):
    """banner列表"""

    add_notice_btn = VueButton("添加")

    def __init__(self):
        super(Table, self).__init__()

class AddNoticeWindow(FloatWindow):
    """增加banner窗口"""

    add_notice_name = ElementBaseLabel(ET.INPUT, "公告名称")
    add_notice_content = ElementBaseLabel(ET.INPUT, "公告内容")#不知道这个富文本框能不能用INPUT，先尝试一下
    add_notice_grid = ElementBaseLabel(ET.GRID, "网格")
    add_notice_grid_select = VueBoxTree(index=1)
    add_notice_face_to = ElementBaseLabel(ET.DROPDOWN_LIST, "面向")
    add_notice_pic = ElementBaseLabel(ET.UPLOAD, "公告图")

    def __init__(self, title=None, index=None):
        super(AddNoticeWindow, self).__init__(index=index, title=title)

class ModifyNoticeWindow(AddNoticeWindow):
    """修改banner窗口"""

    def __init__(self, title=None, index=None):
        super(ModifyNoticeWindow, self).__init__(index=index, title=title)

class NoticeManagePage(Page):
    searchTools = SearchTools()
    addNotice = AddNoticeWindow(title="新增公告")
    modifyNotice = ModifyNoticeWindow(title="公告详情")
    turnPage = VueTurnPage()
    table =Table()